package cn.webestar.scms.user.api.dto.Department;

import cn.webestar.scms.commons.api.PageBody;
import cn.webestar.scms.user.entity.Department;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
@Schema(description = "DepartmentRootPageDTO")
public class DepartmentRootPageDTO extends PageBody {

    @Schema(description = "租户id")
    private Long cid;

    @Override
    public LambdaQueryWrapper<Department> toQueryWapper() {
        LambdaQueryWrapper<Department> queryWrapper = new LambdaQueryWrapper<>();
        if (cid!=null) {
            queryWrapper.eq(Department::getCid, cid);
        }
        return queryWrapper;
    }

}
